<form id="add-form" class="form-horizontal" role="form" data-toggle="validator" >
    <div class="content">
        <div class="panel panel-default panel-intro">

            <div class="panel-body">
                <div id="myTabContent" class="tab-content">
                    <div class="tab-pane fade active in" id="one">
                        <div class="widget-body no-padding">
                            <div class="bootstrap-table">
                                <div class="commonsearch-table ">
                                    <fieldset>
                                        <div class="row">
                                            <div class="form-group col-xs-12 col-sm-6 col-md-4 col-lg-3">
                                                <label for="c-supplier_id" class="control-label col-xs-4">供货商ID</label>
                                                <div class="col-xs-8">
                                                    {if condition="empty($sinfo)"}
                                                    <input id="c-supplier_id" data-rule="required" data-source="supplier/supplier/index" data-field="nickname" class="form-control selectpage" name="supplier_id" type="text" value="{$row.supplier_id}">
                                                    {else /}
                                                    <input id="c-supplier_id" data-rule="required"  class="form-control" name="supplier_id" type="text" value="{$sinfo['nickname']}" disabled>
                                                    {/if}

                                                </div>
                                            </div>
                                            <div class="form-group col-xs-12 col-sm-6 col-md-4 col-lg-3">
                                                <label for="operator" class="control-label col-xs-4">经手人</label>
                                                <div class="col-xs-8">
                                                    <input type="text" class="form-control" name="operator" value="{$row.operator}" placeholder="经手人" id="operator" data-index="6" disabled>
                                                </div>
                                            </div>
                                            <div class="form-group col-xs-12 col-sm-6 col-md-4 col-lg-3">
                                                <label for="company" class="control-label col-xs-4">部门单位</label>
                                                <div class="col-xs-8">
                                                    <input type="text" class="form-control" name="company" value="{$row.company}" placeholder="部门单位" id="company" data-index="7" disabled>
                                                </div>
                                            </div>
                                            <div class="form-group col-xs-12 col-sm-6 col-md-4 col-lg-3">
                                                <label for="company" class="control-label col-xs-4">税点</label>
                                                <div class="col-xs-8">
                                                    <input type="text" class="form-control " data-rule="required" name="tax" value="{$row.tax}" placeholder="税点" id="shuifei" data-index="7" onkeyup="checkTaxFloat(this);">
                                                </div>
                                            </div>
                                            <div class="form-group col-xs-12 col-sm-6 col-md-4 col-lg-3">
                                                <label for="c-storehouse_id" class="control-label col-xs-4">入库仓库</label>
                                                <div class="col-xs-8">
                                                    <input type="hidden" name="storehouse_id" value="{$row['storehouse_id']}">
                                                    <input id="c-storehouse_id" data-rule="required"  class="form-control " name="storehouse_id" type="text" value="{$hname}" disabled>
                                                </div>
                                            </div>
                                            <div class="form-group col-xs-12 col-sm-6 col-md-4 col-lg-3">
                                                <label for="explain" class="control-label col-xs-4">说明</label>
                                                <div class="col-xs-8">
                                                    <input type="text" class="form-control" name="explain" value="{$row.explain}" placeholder="说明" id="explain" data-index="13">
                                                </div>
                                            </div>

                                            <!--                                            <div class="form-group col-xs-12 col-sm-6 col-md-4 col-lg-3">-->
                                            <!--                                                <label for="explain" class="control-label col-xs-4">总运费</label>-->
                                            <!--                                                <div class="col-xs-8">-->
                                            <!--                                                    <input type="number" class="form-control" data-rule="required" name="allfare" value="" placeholder="总运费" id="allfare" data-index="13">-->
                                            <!--                                                </div>-->
                                            <!--                                            </div>-->

                                        </div>
                                    </fieldset>
                                </div>
                            </div>
                        </div>
                        <table id="table" class="table table-striped table-bordered table-hover table-nowrap" style="display: block;overflow:auto;" data-operate-edit="1" data-operate-del="1" width="auto">
                            <thead>
                            <tr>
                                <!--                                        <th class="bs-checkbox " style="text-align: center; vertical-align: middle; width: 36px; " data-field="0">-->
                                <!--                                            <div class="th-inner ">-->
                                <!--                                                <input name="btSelectAll" type="checkbox">-->
                                <!--                                            </div>-->
                                <!--                                        </th>-->
                                <th style="text-align: center; vertical-align: middle; " data-field="id">
                                    <div class="th-inner ">Id</div>
                                    <div class="fht-cell">

                                    </div>
                                </th>
                                <th style="text-align: center; vertical-align: middle; " data-field="createtime">
                                    <div class="th-inner ">商品编号</div>
                                </th>
                                <th style="text-align: center; vertical-align: middle; " data-field="number"><div class="th-inner ">请购人</div>
                                </th>
                                <th style="text-align: center; vertical-align: middle; " data-field="number"><div class="th-inner ">商品名称</div>
                                </th>

                                <th style="text-align: center; vertical-align: middle; " data-field="status">
                                    <div class="th-inner ">产地</div>
                                </th>
                                <th style="text-align: center; vertical-align: middle; " data-field="supplier_id">
                                    <div class="th-inner ">规格</div>
                                </th>
                                <th style="text-align: center; vertical-align: middle; " data-field="operator">
                                    <div class="th-inner ">账面库存</div>
                                </th>
                                <th style="text-align: center; vertical-align: middle; " data-field="company">
                                    <div class="th-inner ">虚拟库存
                                    </div>
                                </th>
                                <th style="text-align: center; vertical-align: middle; " data-field="order_goods_total"><div class="th-inner ">采购数量</div><div class="fht-cell"></div></th>
                                <th style="text-align: center; vertical-align: middle; " data-field="arrival_total"><div class="th-inner ">采购单位</div><div class="fht-cell"></div></th>
                                <th style="text-align: center; vertical-align: middle; " data-field="order_price"><div class="th-inner ">采购单价</div><div class="fht-cell"></div></th>
                                <th style="text-align: center; vertical-align: middle; " data-field="order_price"><div class="th-inner ">采购金额</div><div class="fht-cell"></div></th>
                                <th style="text-align: center; vertical-align: middle; " data-field="arrival_price"><div class="th-inner ">税点</div><div class="fht-cell"></div></th>
                                <th style="text-align: center; vertical-align: middle; width: 80px;" data-field="paid_in_price"><div class="th-inner ">含税单价</div><div class="fht-cell"></div></th>
                                <th style="text-align: center; vertical-align: middle; " data-field="paid_in_price"><div class="th-inner ">税额</div><div class="fht-cell"></div></th>

                                <!--                                        <th style="text-align: center; vertical-align: middle; " data-field="explain"><div class="th-inner ">所有运费</div><div class="fht-cell"></div></th>-->
                                <!--                                        <th style="text-align: center; vertical-align: middle; " data-field="explain"><div class="th-inner ">单件运费</div><div class="fht-cell"></div></th>-->
                                <th style="text-align: center; vertical-align: middle; " data-field="explain"><div class="th-inner ">合计</div><div class="fht-cell"></div></th>
                                <!--                                                <th style="text-align: center; vertical-align: middle; " data-field="abstract"><div class="th-inner ">已收获数量</div><div class="fht-cell"></div></th>-->
                                <th style="text-align: center; vertical-align: middle; " data-field="operate"><div class="th-inner ">备注</div><div class="fht-cell"></div></th>
<!--                                <th style="text-align: center; vertical-align: middle; " data-field="operate"><div class="th-inner ">操作</div><div class="fht-cell"></div></th>-->
                            </tr>
                            </thead>
                            <tbody data-listidx="0" class="connnn">
                            {volist name="list" id="vo"}
                                <tr data-index="0">
                                <td style="text-align: center; vertical-align: middle; "><input name="row[{$vo.id}][goods_id]" value="{$vo.id}" style="display: none" class="gids{$vo.id}">{$vo.id}</td>
                                <td style="text-align: center; vertical-align: middle; ">{$vo.number}</td>
                                <td style="text-align: center; vertical-align: middle; " >{$vo.nickname}</td>
                                <td style="text-align: center; vertical-align: middle; " class="title">{$vo.title}</td>
                                <td style="text-align: center; vertical-align: middle; ">{$vo.place_origin}</td>
                                <td style="text-align: center; vertical-align: middle; ">{$vo.specs}</td>
                                <td style="text-align: center; vertical-align: middle; ">{$vo.stock}</td>
                                <td style="text-align: center; vertical-align: middle; ">{$vo.xstock}</td>
                                <td style="text-align: center; vertical-align: middle; " class="xxgg">
                                    <input type="hidden" class="requisition_num" name="row[{$vo.id}][goods_num]" value="{$vo.goods_num}">{$vo.goods_num}</td>
                                <td style="text-align: center; vertical-align: middle; ">{$vo.unit}</td>
                                <td style="text-align: center; vertical-align: middle; " class="">
                                    <input type="text" class="form-control" style="display: none" value="{$vo.unit_price}" name="row[{$vo.id}][unit_price]" onkeyup="checkInputIntFloat(this);">
                                    <span class="price">{$vo.unit_price}</span>
                                </td>
                                <td style="text-align: center; vertical-align: middle; " class="allprice">0</td>
                                <td style="text-align: center; vertical-align: middle; " class="">
                                    <input type="text" class="form-control" style="display: none" value="{$vo.tax}" name="row[{$vo.id}][tax]">
                                    <span class="tax ">{$vo.tax}</span>
                                </td>

                                <td style="text-align: center; vertical-align: middle; " class="xxgg">
                                    <input type="text" class="form-control ht_prices" style="display: none" value="{$vo.ht_price}" name="row[{$vo.id}][ht_price]">
                                    <span class="ht_price">{$vo.ht_price}</span>
                                </td>
                                <td style="text-align: center; vertical-align: middle; " class="taxall">0.00</td>
                                <td style="text-align: center; vertical-align: middle; " class="sfhj">0</td>
                                <td style="text-align: center; vertical-align: middle; " class="xxgg">
                                    <input type="text" class="form-control" style="display: none" value="{$vo.remark}" name="row[{$vo.id}][remark]">
                                    <span class="tremark ">{$vo.remark}</span></td>
                            </tr>
                            {/volist}
                            </tbody>
                            <tbody class="tbfoot" data-listidx="0" style="display: ">
                                <td style="text-align: center; vertical-align: middle; ">合计</td>
                                <!--                                        <td style="text-align: center; vertical-align: middle; "></td>-->
                                <td style="text-align: center; vertical-align: middle; "></td>
                                <td style="text-align: center; vertical-align: middle; "></td>
                                <td style="text-align: center; vertical-align: middle; "></td>
                                <td style="text-align: center; vertical-align: middle; "></td>
                                <td style="text-align: center; vertical-align: middle; "></td>
                                <td style="text-align: center; vertical-align: middle; " class="zstock"></td>
                                <td style="text-align: center; vertical-align: middle; " class="xstock"></td>
                                <td style="text-align: center; vertical-align: middle; " class="allnum">0</td>
                                <td style="text-align: center; vertical-align: middle; "></td>
                                <td style="text-align: center; vertical-align: middle; " ></td>
                                <td style="text-align: center; vertical-align: middle; "class="alprice">0</td>
                                <td style="text-align: center; vertical-align: middle; "></td>
                                <td style="text-align: center; vertical-align: middle; "></td>
                                <td style="text-align: center; vertical-align: middle; "class="alltax">0</td>
                                <!--                                        <td style="text-align: center; vertical-align: middle; "class="fare">0</td>-->
                                <!--                                        <td style="text-align: center; vertical-align: middle; "class="cost"></td>-->
                                <td style="text-align: center; vertical-align: middle; "class="price_tax">0</td>
                                <td style="text-align: center; vertical-align: middle; "></td>
<!--                            <td style="text-align: center; vertical-align: middle; "></td>-->
                            </tbody>
                        </table>
                    </div>
                </div>
            </div>
        </div>
    </div>
    <div class="form-group layer-footer">
        <label class="control-label col-xs-12 col-sm-2"></label>
        <div class="col-xs-12 col-sm-8">
            <button type="submit" class="btn btn-success btn-embossed  subpurchase">{:__('确定')}
            </button>
            <!--        <button type="reset" class="btn btn-default btn-embossed  reject">{:__('驳回')}</button>-->
        </div>
    </div>
</form>
</div>


<input type="hidden" value="{$row.id}" id="order_id">

<script src="https://cdn.bootcdn.net/ajax/libs/jquery/3.5.1/jquery.js"></script>
{include file='common/caifooter' /}
<script>
    $('thead').on('mousedown','th',function (e) {
        if(3 == e.which){
            var index3 = $(this).index()
            console.log(index3)
            index= $("thead").find('th').index(this);
            $('thead').find('th').eq(index).remove()
            $('tbody').find('tr').each(function () {
                $(this).find('td').eq(index).remove()
            })
            $('tbody').find('th').eq(index).remove()

            console.log(index)
            $(document).bind("contextmenu",function(e){
                return false;
            })
        }
    })
</script>